repo: Add two more cap-std APIs
authorColin Walters <walters@verbum.org>
Thu, 3 Feb 2022 13:54:37 +0000 (08:54 -0500)
committerColin Walters <walters@verbum.org>
Fri, 6 May 2022 16:53:57 +0000 (12:53 -0400)
commit19224a411af0c77f0855fd812b0c16d966129c63
treea886b7b72edeb876a701491028e694a86d6e8460
parent6940896c4e4ef9cc39f841fae3c58622481cb427
repo: Add two more cap-std APIs

Followup to the previous PR.  I realized now with `io_lifetimes`
we can offer a safe `dfd_borrow()` that *borrows* the file descriptor
for the repository.  (In contrast to the current `.dfd()` that returns
the raw version)

Building on that, add another API that re-acquires a `Dir` instance.
(In the future in theory we could optimize this more by knowing
 whether or not the repo was constructed via cap-std, and perhaps
 in theory synthesize a `&Dir` reference, but I don't think we
 need that now)
rust-bindings/rust/src/repo.rs
rust-bindings/rust/tests/repo/mod.rs